package lxh.com.union.logic_business.present;

import com.lzy.okgo.OkGo;

import lxh.com.union.frame.mvp.BasePresent;
import lxh.com.union.logic_business.model.bean.ConmmunityBannerBean;
import lxh.com.union.logic_business.model.bean.ConmmunityHotTagBean;
import lxh.com.union.logic_business.model.net.INetCallBack;
import lxh.com.union.logic_business.model.net.MyCallBack;
import lxh.com.union.logic_business.model.net.UrlConstant;
import lxh.com.union.logic_business.ui.mvpview.IConmmunityView;
import lxh.com.union.logic_business.util.ToastUtils;

/**
 * Created by Administrator on 2017/11/28.
 */

public class ConmmunityPresent extends BasePresent<IConmmunityView> {
    public void loadConmmunityBannerData(){
        OkGo.<String>get(UrlConstant.COMMUNITY_BANNER).tag(this)
                .execute(new MyCallBack(ConmmunityBannerBean.class, new INetCallBack() {
                    @Override
                    public void success(Object o) {
                        getView().getConmmunityBannerData((ConmmunityBannerBean) o);
                    }

                    @Override
                    public void failed(Object o) {
                        ToastUtils.showLong(o.toString());
                    }
                }));
    }
    public void loadConmmunityHotTagData(){
        OkGo.<String>get(UrlConstant.CHOOSE_LABEL).tag(this)
                .execute(new MyCallBack(ConmmunityHotTagBean.class, new INetCallBack() {
                    @Override
                    public void success(Object o) {
                        getView().getConmmunityHotTagData((ConmmunityHotTagBean) o);
                    }

                    @Override
                    public void failed(Object o) {
                        ToastUtils.showLong(o.toString());
                    }
                }));
    }
}
